#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 3e3 + 10;
const int mod = 1e9 + 7;

int n, m;
int f[N][N];
char s[N][N];

int calc(int sx, int sy, int tx, int ty) {
  memset(f, 0, sizeof f);
  f[sx][sy] = 1;
  rep(i, 1, n) rep(j, 1, m) {
    if(s[i][j] == '#') { f[i][j] = 0; continue; }
    //    if(f[i][j]) cerr << i << " " << j << " " << f[i][j] << endl;
    f[i + 1][j] = (f[i + 1][j] + f[i][j]) % mod;
    f[i][j + 1] = (f[i][j + 1] + f[i][j]) % mod;
  } return f[tx][ty];
}

int main() {
#ifndef ONLINE_JUDGE
  //	freopen("1.in", "r", stdin);
#endif
	n = in, m = in;
	rep(i, 1, n) scanf("%s", s[i] + 1);
	int ans1 = 1ll * calc(1, 2, n - 1, m) * calc(2, 1, n, m - 1) % mod;
	int ans2 = 1ll * calc(1, 2, n, m - 1) * calc(2, 1, n - 1, m) % mod;
	//	cerr << ans1 << " " << ans2 << endl;
	int ans = (ans1 - ans2 + mod) % mod;
	printf("%d\n", ans);
	return 0;
}
